import Taro from '@tarojs/taro';
import {Image, View} from '@tarojs/components';
import {connect} from "@tarojs/redux";
import Success from '../../../asset/images/success.png';
import SbIcon from '../../../asset/images/sb_icon.png';
import TimerNone from '../../../asset/images/timer_none.png';
import './affirmSuccess.scss';
import {actionCreator} from "../../../store/actions";

class AffirmSuccess extends Taro.Component {
    config = {
        navigationBarTitleText: '支付成功',
        backgroundColor: '#fff',
    };

    state = {
    };

    componentDidMount() {

    }

    //返回首页
    return = () => {
        const {getSearchTitle} = this.props;
        getSearchTitle('课程 / 地点 / 瘦身塑形');
        Taro.switchTab({
            url: '/pages/index/index'
        })
    };

    //查看订单
    skipDetail = () => {
        Taro.switchTab({
            url: '/pages/order/order'
        })
    };

    render() {
        const {} = this.state;
        return (
            <View className="page">
                <View className="affirm-head">
                    <Image className="affirm-success-img" src={Success}></Image>
                    <View className="affirm-success-text">约课成功，教练已确认</View>
                    {/*<View className="affirm-success-money">¥{this.$router.params.price}</View>*/}
                    <View className="affirm-success-btn">
                        <View className="btn" onClick={this.return}>返回主页</View>
                        <View className="btn btn-return" onClick={this.skipDetail}>查看订单</View>
                    </View>
                    {/*<View className="affirm-qx-btn">取消订单</View>*/}
                </View>
            </View>
        )
    }
}

const mapStateToProps = state => {
    let {} = state;
    return {
    }
};

const mapDispatchToProps = {
    getSearchTitle: actionCreator.getSearchTitle,
};

export default connect(mapStateToProps, mapDispatchToProps)(AffirmSuccess);



